import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { NzModalService } from 'ng-zorro-antd/modal';
import { User } from 'src/app/models';
@Component({
  selector: 'zepride-user-info',
  templateUrl: './user-info.component.html',
  styleUrls: ['./user-info.component.less']
})
export class UserInfoComponent implements OnInit {

  @Input() user: User;
  @Output() logOut: EventEmitter<any> = new EventEmitter<any>();

  constructor(
    private modal: NzModalService
  ) { }

  ngOnInit(): void { }

  logOutEvent() {
    this.modal.confirm({
      nzContent: '确认退出？',
      nzOnOk: () => {
        this.logOut.emit();
      }
    });
  }
}
